package com.gethb.pub.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSON;


public abstract class BaseInVo<T> {
	
	private static final Logger LOG = LoggerFactory.getLogger(BaseInVo.class);
	
	/**
	 * JSON字符串转换成InVo
	 * @param jsonString
	 * @param inVoClass
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public static <R extends BaseInVo> R parseJsonStr(String jsonString, Class<R> inVoClass){
		R invo = JSON.toJavaObject(JSON.parseObject(jsonString), inVoClass);

		if (null == invo) {
			LOG.error("解析JSON字符串invo是null");
//			throw new CommonRuntimeException("XATP8GZF0002");
		}
		return invo;
	}

}
